#include<reg52.h>
#define duan P0
#define uchar unsigned char
#define uint unsigned int
	
sbit w1 = P2^4;
sbit w2 = P2^5;
sbit w3 = P2^6;
sbit w4 = P2^7;

uchar code sz[17] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71, 0x00};
	
void delay(uint xms)
{
		uint i, j;
		for (i = xms; i > 0; i--)
				for (j = 112; j > 0; j--);
}

void main(void)
{
		while (1)
		{
				duan = sz[4];
				w1 = 0;
				w2 = 0;
				w3 = 0;
				w4 = 1;
				delay(5);
				duan = sz[3];
				w1 = 0;
				w2 = 0;
				w3 = 1;
				w4 = 0;
				delay(5);
				duan = sz[2];
				w1 = 0;
				w2 = 1;
				w3 = 0;
				w4 = 0;
				delay(5);	
				duan = sz[1];
				w1 = 1;
				w2 = 0;
				w3 = 0;
				w4 = 0;
				delay(5);	
		}
}